home *** CD-ROM | disk | FTP | other *** search
/ SunSoft Catalyst CDWARE 1996 May to August / Catalyst CDWARE 1996 May to August.iso / .products / .bin / httpd / Solaris_2 / today < prev    next >
Text File  |  1995-12-09  |  1KB  |  57 lines

  1. #!./perl
  2.  
  3. #
  4. # This script will redirect the client to /channel/day or /channel/night
  5. # depending on the time of day (according to the server).
  6. #
  7.  
  8.  
  9. #require "ctime.pl";
  10. #
  11. # Play with these variables to meet your needs
  12. #
  13. $day_path = "";
  14. $night_path = "#night";
  15. $start_day = 7;       # Daytime starts at 7 am
  16. $start_night = 19;    # Nightime starts at 7 pm
  17.  
  18. #
  19. # The code starts here
  20. #
  21. @day = split (' ', `/usr/bin/date` );
  22.  
  23. #print $day[2];
  24.  
  25. @today = split (' ', `/usr/bin/time` );
  26.  
  27.  
  28. ($hour,$min,$sec) = split(':',$today[3]);
  29. if ($hour >= $start_night || $hour < $start_day) {
  30.     # Ok, we're in nightime
  31.     $redirpath = $night_path;
  32. }
  33. else {
  34.     # It's daytime
  35.     $redirpath = $day_path;
  36. }
  37.  
  38.  
  39. $file = "day$day[2].html";
  40.     print "Content-type: text/html\n\n";
  41.     print "<html><head>\n";
  42.     print "<title>Disney Channel Program Guide</title>\n";
  43.     print "</head>\n<body>\n";
  44.  
  45.  
  46. open(DAY,"../docs/disney/tdc/program_guide/days/$file");
  47. while (<DAY>) {
  48. print STDOUT $_;
  49. }
  50. close(DAY);
  51.  
  52.  
  53.  
  54.  
  55. #print "Location: http://snl.eng\n\n";
  56.  
  57.